

export default function(value) {
    const {syncTree, button, editTable} = this.props;
    let {disabledTreeNodeList} = this.state;

    let currentDisabled = disabledTreeNodeList.includes(value);

    if(value === 'root') {
        this.setState({
            currentSelectDepartment: ''
        }, () => {
            if(this.state.hasSearched) {
                this.getMainTableData();
            }
        });
        this.props.button.setButtonDisabled({
            grpadd: false,
            grpedit: true,
            grpdel: true,
            grpref: false,
            grpena: true,
            grpdis: true,
            Delete: true,
            stop: true,
            refadd: true
        });
    }
    else {

        this.setState({
            currentSelectDepartment: value
        }, () => {
            if(this.state.hasSearched) {
                this.getMainTableData();
            }
        });

        button.setButtonDisabled({
            refadd: currentDisabled,
            grpadd: currentDisabled,
            grpedit: currentDisabled,
            grpdel: false,
            grpref: false,
            grpena: !currentDisabled,
            grpdis: currentDisabled,
            Delete: false,
            stop: false
        });
        
        
        this.doDisabledTreeNodeList();
        this.addPerson();
    }
    
}